<template>
  <div class="follow-box">
    <div class="follow-header">
      <!-- 引入封装的组件，传递视频列表 -->
      <UserDynamicList :current-video="currentVideo" />
    </div>
  </div>
  <CommentSection />
</template>

<script setup>
import { getFollowedListAPI } from "@/api/followed/followed";
import { useUserStore } from "@/store/modules/user/user";
import CommentSection from '@/components/common/commentSection.vue';
import UserDynamicList from '@/components/common/UserDynamicList.vue'; // 引入封装的组件
import { ref, onMounted } from "vue";

const userStore = useUserStore();
const userId = userStore.userInfo.userId;
const currentVideo = ref([]); // 存储视频列表

// 获取关注列表
const getFollowedList = async () => {
  const res = await getFollowedListAPI(userId);
  if (res.code === 200) {
    currentVideo.value = res.data;
  }
}

onMounted(() => {
  getFollowedList();
});
</script>

